﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

/*  0x0400 0000 to 0x0400 0FFF  SP_DMEM read/write
    0x0400 1000 to 0x0400 1FFF  SP_IMEM read/write
    0x0400 2000 to 0x0403 FFFF  Unused
    0x0404 0000 to 0x0404 0003  SP_MEM_ADDR_REG
    0x0404 0004 to 0x0404 0007  SP_DRAM_ADDR_REG
    0x0404 0008 to 0x0404 000B  SP_RD_LEN_REG
    0x0404 000C to 0x0404 000F  SP_WR_LEN_REG
    0x0404 0010 to 0x0404 0013  SP_STATUS_REG
    0x0404 0014 to 0x0404 0017  SP_DMA_FULL_REG
    0x0404 0018 to 0x0404 001B  SP_DMA_BUSY_REG
    0x0404 001C to 0x0404 001F  SP_SEMAPHORE_REG
    0x0404 0020 to 0x0407 FFFF  Unused
    0x0408 0000 to 0x0408 0003  SP_PC_REG
    0x0408 0004 to 0x0408 0007  SP_IBIST_REG
    0x0408 0008 to 0x040F FFFF  Unused*/

namespace Super64.Core.Memory.Ram.Registers
{
    [StructLayout(LayoutKind.Sequential, Pack = 4)]
    public unsafe struct SPRegisters
    {
        public fixed byte DMemory[0xFFF];
        public fixed byte IMemory[0xFFF];
        public fixed byte Unused[0xFFF];
        public uint MemoryAddress;
        public uint DRAMMemoryAddress;
        public uint ReadLength;
        public uint WriteLength;
        public uint Status;
        public uint DMAFull;
        public uint DMABusy;
        public uint Semaphore;
        public fixed byte UnusedA[0xFFDF];
        public uint ProramCounter;
        public uint IBist;
    }
}
